package waggle.server;

import waggle.client.bean.User;

/**
 * This is a service interface for sessions. It is used to check for valid
 * session ids and to get user ids for valid sessions.
 * 
 */
// @ImplementedBy(SessionIdServiceImpl.class)
public interface SessionIdService {
  /**
   * Returns the {@link User} associated with a session id. If the session id is
   * not valid, returns null.
   * 
   * @param sid the session id
   * @return user session id is valid, otherwise null
   */
  public User getUserBySessionId(String sid);

  /**
   * Returns true if the session id is valid by checking the user database.
   * 
   * @param sid the session id to check
   * @return true if session id is valid, otherwise false
   */
  public boolean isSessionIdValid(String sid);
}
